package com.minimalist.common.entity.tc.entity.vo.plateNumber;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import java.util.Objects;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author 11987
 */
@Schema(description = "停车_车牌信息实体")
public class TcPlateNumberVO implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @JsonSerialize(using = ToStringSerializer.class)
    @NotNull(message = "车牌信息ID不能为空", groups = {Update.class})
    @Schema(name = "plateNumberId", description = "车牌ID", type = "string")
    private Long plateNumberId;

    @NotNull(message = "车牌名称不能为空", groups = {Add.class, Update.class})
    @Schema(name = "plateNumberId", description = "车牌名称", type = "string")
    private String plateNumberName;

    @Schema(name = "vehicleModel", description = "车型名称", type = "string")
    private String vehicleModel;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "fileId", description = "文件ID", type = "string")
    private Long fileId;

    @Schema(name = "fileUrl", description = "文件URL", type = "string")
    private String fileUrl;

    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "identifyResult", description = "识别结果", type = "string")
    private String identifyResult;

    public Long getPlateNumberId() {
        return plateNumberId;
    }

    public void setPlateNumberId(Long plateNumberId) {
        this.plateNumberId = plateNumberId;
    }

    public String getPlateNumberName() {
        return plateNumberName;
    }

    public void setPlateNumberName(String plateNumberName) {
        this.plateNumberName = plateNumberName;
    }

    public String getVehicleModel() {
        return vehicleModel;
    }

    public void setVehicleModel(String vehicleModel) {
        this.vehicleModel = vehicleModel;
    }

    public Long getFileId() {
        return fileId;
    }

    public void setFileId(Long fileId) {
        this.fileId = fileId;
    }

    public String getFileUrl() {
        return fileUrl;
    }

    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }

    public String getIdentifyResult() {
        return identifyResult;
    }

    public void setIdentifyResult(String identifyResult) {
        this.identifyResult = identifyResult;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TcPlateNumberVO that = (TcPlateNumberVO) o;
        return Objects.equals(plateNumberId, that.plateNumberId) &&
               Objects.equals(plateNumberName, that.plateNumberName) &&
               Objects.equals(vehicleModel, that.vehicleModel) &&
               Objects.equals(fileId, that.fileId) &&
               Objects.equals(fileUrl, that.fileUrl) &&
               Objects.equals(identifyResult, that.identifyResult);
    }

    @Override
    public int hashCode() {
        return Objects.hash(plateNumberId, plateNumberName, vehicleModel, fileId, fileUrl, identifyResult);
    }

    @Override
    public String toString() {
        return "TcPlateNumberVO{" +
               "plateNumberId=" + plateNumberId +
               ", plateNumberName='" + plateNumberName + '\'' +
               ", vehicleModel='" + vehicleModel + '\'' +
               ", fileId=" + fileId +
               ", fileUrl='" + fileUrl + '\'' +
               ", identifyResult='" + identifyResult + '\'' +
               '}';
    }
}
